<template>
  <div class="amend_project_type">

    <el-row>
      <el-col :span="24"><div class="title-amend-type">修改项目类型</div></el-col>
    </el-row>

    <el-form
      class="amend-type-form"
      ref="form"
      :model="form"
      label-width="200px"
      :label-position="labelPosition">
      <el-form-item label="项目类型名称：" prop="name">
        <el-input v-model="form.typeName" style="width: 220px;"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary"  @click="submitForm('form')">保存</el-button>
        <el-button class="btn-item-cancel"  @click="resetForm('form')">取消</el-button>
      </el-form-item>
    </el-form>


  </div>
</template>

<script>

  export default {
    data(){
      return{
        labelPosition:'left',
        form: {
          typeName: '',
        }
      }
    },
    methods:{
      submitForm(formName) {
//        this.$refs[formName].validate((valid) => {
        this.$refs[formName].validate(
          function(valid) {
            if (valid) {
              alert('submit!');
            } else {
//            console.log('error submit!!');
              return false;
            }
          });
      },
      resetForm(formName) {
        this.$refs[formName].resetFields();
      }
    }
  }
</script>

<style>
  .amend_project_type .title-amend-type{
    height: 60px;
    line-height: 60px;
    font-size: 18px;
    padding-left: 30px;
    margin-bottom: 10px;
    color: #333333;
    background: #ffffff;
  }
  .amend_project_type .amend-type-form{
    background: #ffffff;
    padding: 50px 0 50px 30px;
  }
  .amend_project_type .amend-type-form label.el-form-item__label{
    font-size: 16px;
    color: #666666;
  }
  .amend_project_type .amend-type-form .el-form-item{
    margin-bottom: 50px;
  }
  .amend_project_type .amend-type-form .btn-item-cancel{
    margin-left: 100px;
  }
</style>
